<?php
/* 
 * Copyright (c) 2018-2021   All rights reserved.
 *
 * 创建时间：2021-11-25 20:03:14
 *
 * 项目：/ipban  -  $  - BaseIpbanRecordCensusModel.php
 *
 * 作者：{{AUTO GENERATE}}
 */

//此文件使用程序自动生成，下次生成时会覆盖，不建议修改。

namespace modules\levs\modules\ipban\table\ipban_record_census;

use Lev;
use lev\base\Modelv;
use lev\base\SubModelv;

!defined('INLEV') && exit('Access Denied LEV');


class BaseIpbanRecordCensusModel extends SubModelv
{

    public static $tableName = '{{%ipban_record_census}}';

    public static function safeColumnsGen($columns)
    {
        $allColumns = static::allColumns();
        if (is_array($allColumns)) {
            foreach ($columns as $field => $value) {
                if (!isset($allColumns[$field])) unset($columns[$field]);
            }
        }
        return parent::safeColumnsGen($columns); // TODO: Change the autogenerated stub
    }

    public static function allColumns() {
        return array(
                'id'         => 'Id',

                'pagename'   => '页面标识',

                'ip'         => 'IP',

                'iptotal'    => 'IP计数',

                'pagetotal'  => 'page计数',

                'requesturi' => '请求地址',

                'referer'    => '来源地址',

                'useragent'  => '用户标识',

                'settings'   => '通用设置',

                'status'     => '状态',

                'uptime'     => '更新时间',

                'addtime'    => '添加时间',

        );
    }

    public static function inputs($iden = '', $keyfield = '', $classify = null)
    {
        //return parent::inputs($iden, $keyfield, $classify); // TODO: Change the autogenerated stub
        return array(

            'id' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => 'Id',
                    'placeholder'      => '',
                    'inputname'        => 'id',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'pagename' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => '页面标识',
                    'placeholder'      => '',
                    'inputname'        => 'pagename',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'ip' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => 'IP',
                    'placeholder'      => '',
                    'inputname'        => 'ip',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'iptotal' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => 'IP计数',
                    'placeholder'      => '',
                    'inputname'        => 'iptotal',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'pagetotal' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => 'page计数',
                    'placeholder'      => '',
                    'inputname'        => 'pagetotal',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'requesturi' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => '请求地址',
                    'placeholder'      => '',
                    'inputname'        => 'requesturi',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'referer' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => '来源地址',
                    'placeholder'      => '',
                    'inputname'        => 'referer',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'useragent' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => '用户标识',
                    'placeholder'      => '',
                    'inputname'        => 'useragent',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'settings' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => '通用设置',
                    'placeholder'      => '<tips>【提示】序列化字段不了解情况下不要修改，否则会导致整个字段数据丢失</tips>',
                    'inputname'        => 'settings',
                    'inputtype'        => 'textarea',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'status' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => '状态',
                    'placeholder'      => '',
                    'inputname'        => 'status',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'uptime' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => '更新时间',
                    'placeholder'      => '',
                    'inputname'        => 'uptime',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
            'addtime' => array (
                    'moduleidentifier' => 'ipban',
                    'classify'         => '',
                    'title'            => '添加时间',
                    'placeholder'      => '',
                    'inputname'        => 'addtime',
                    'inputtype'        => 'text',
                    'inputvalue'       => '',
                    'settings'         => '',
                    'displayorder'     => '0',
                    'status'           => '0',
            ),
        );
    }

    public static function setupDesc()
    {
        //return parent::setupDesc(); // TODO: Change the autogenerated stub
        return "{{setupDesc}}";
    }

    public static function getNextSetup()
    {
        return parent::getNextSetup(); // TODO: Change the autogenerated stub
    }

    public static function inputsSetup()
    {
        return parent::inputsSetup(); // TODO: Change the autogenerated stub
    }

    /**
     * 额外的表单字段，不会存入数据库
     * @return array inputs
     */
    public static function extInputs() {
        return [];
    }

    //eg: <div class="card card-header"></div>
    /**
     * 表单头部htm
     * @return string
     */
    public static function headerHtm() {
        return !Lev::isDeveloper(Lev::$app['iden']) ? '' :
            '<tips class="gray inblk scale8">自定义headerHtm：文件位置：'.__DIR__ . '/ipbanRecordCensusModelHelper.php'.'</tips>';
    }

    /**
     * 表单底部htm
     * <tips class="gray inblk scale8">自定义footerHtm</tips>
     * @return string
     */
    public static function footerHtm() {
        return '';
    }

    /**
     * 表单底部内部htm
     * <tips class="gray inblk scale8">自定义footerFormInnerHtm</tips>
     * @return string
     */
    public static function footerFormInnerHtm() {
        return '';
    }

}